Skip to content

docs: parallel traversal design (#43) - #139

Merged
helly25 merged 1 commit into
mainfrom
docs/parallel-traversal
Jun 27, 2026
Merged

docs: parallel traversal design (#43)#139
helly25 merged 1 commit into
mainfrom
docs/parallel-traversal

Conversation

@helly25

@helly25 helly25 commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Design-of-record for the flagship parallel traversal (#43), settled in discussion. No code - this is the spec the implementation PRs build to.

Decisions captured

  • Architecture: bounded worker pool over directories + one emission-ordering layer that owns the sink (matching runs parallel; emission is single-writer/ordered).
  • --sort spectrum (rising cost): none -> dir (per-dir listing) -> subtree (contiguous subtrees, bounded buffer) -> tree (global path order, full buffer). name stays an alias for dir.
  • Parallelism: a single -j N / --jobs knob caps walk + -exec/-capture concurrency; -j 1 = sequential.
  • Mode-scoped defaults: find/fd/rg = all cores + --sort=none; modern = max(1, min(cores-1, 15)) workers + --sort=dir.
  • Concurrency correctness: -prune/-quit/-depth, exit-code model, and thread-safety (VFS already thread-safe; sink/captures/summary funnelled through the ordering layer or sharded).
  • TSan: a separate --config=tsan + clang-tsan CI cell, landed in the same PR that introduces threads.
  • Phasing: a chain of stacked PRs (worker pool + none + tsan -> dir -> subtree -> tree -> -j + mode defaults).

Formatted/linted via trunk (prettier + markdownlint clean).

Design of record for parallel directory traversal and --sort, settled with
the user: worker pool over directories + one emission-ordering layer owning
the sink; four --sort modes (none/dir/subtree/tree) as a rising-cost
spectrum; single -j/--jobs knob for walk + exec; mode-scoped defaults
(find/fd/rg = all cores + none; modern = max(1,min(cores-1,15)) + dir);
concurrency correctness for prune/quit/depth/exit-code; a separate
--config=tsan + clang-tsan CI cell landed with the threads; phased as a
chain of stacked PRs. No code yet -- this is the spec to build to.
@helly25
helly25 enabled auto-merge (squash) June 27, 2026 10:45
@helly25
helly25 merged commit 204d597 into main Jun 27, 2026
7 checks passed
@helly25
helly25 deleted the docs/parallel-traversal branch June 27, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant